﻿using System;
using CivilRegistry.ControlledModel.Extensions;

namespace CivilRegistry.ControlledModel
{
    /// <summary>
    /// The permanent address object.
    /// </summary>
    public partial class PermanentAddress
    {
        /// <summary>
        /// Validates the <see cref="PermanentAddress"/>.
        /// </summary>
        /// <param name="permanentAddress">The <see cref="PermanentAddress"/> to validate.</param>
        /// <exception cref="ArgumentNullException">If the required fields are null or having default values.</exception>
        internal static void Validate(PermanentAddress permanentAddress)
        {
            permanentAddress.Address.Required("Address");
            permanentAddress.PIN.Required("PIN");
            permanentAddress.District.Required("District");
            permanentAddress.City.Required("City");
        }
    }
}